<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>eval</title>
		<script src="js/json2.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			// var str = 'alert("hello")';
			// eval(str);

			// var jsonObjStr = '{"name": "孙悟空","age": 1000,"gender": "男"}';
			// var result = eval("(" + jsonObjStr + ")");
			// console.log(result); // {age: 1000, gender: "男", name: "孙悟空"}
			
			// console.log(JSON.parse(jsonObjStr)); // {age: 1000, gender: "男", name: "孙悟空"}
			
			var jsonObjStr = '{name: "孙悟空","age": 1000,"gender": "男"}';
			console.log(JSON.parse(jsonObjStr));
		</script>
	</head>
	<body>
	</body>
</html>
